<template>
  <micro-app :name="name" :url="legacyBaseUrl" :default-page="'/#' + path" keep-alive iframe
    style="height: 100%;">
  </micro-app>
</template>

<script lang="ts" setup>
import microApp from '@micro-zoe/micro-app'
import type { PropType, } from 'vue'

defineProps({
  name: {
    type: String as PropType<string>,
    required: true
  },
  path: {
    type: String as PropType<string>,
    required: true
  },
  groupCode: {
    type: String as PropType<string>,
    required: true
  },
  keepAlive: {
    type: Boolean as PropType<boolean>,
  },
})


const legacyBaseUrl = import.meta.env.VITE_MICRO_APP_LOCAL_URL
</script>

<style>
  .no-scroll micro-app-body #base-app {
    overflow-y: hidden;
  }
  micro-app:not(.no-scroll) micro-app-body #base-app {
    overflow-y: auto !important;
  }
</style>
